<template>
  <div class="report-container">
    <!-- 导航栏 -->

    <div class="navbar">
      <div class="nav-back" @click="$router.go(-1)">
        <i class="fas fa-chevron-left"></i>
      </div>
      <div class="nav-title">历史测评报告</div>
      <div class="nav-placeholder"></div>
    </div>

    <!-- 加载状态 -->
    <div v-if="loading" class="loading-container">
      <div class="loading-spinner"></div>
      <p class="loading-text">正在加载报告，请稍候...</p>
    </div>

    <!-- 报告内容 -->
    <div v-else-if="hasReportData" class="report-content">
      <!-- 报告说明 -->
      <div class="report-intro-section">
        <div class="intro-header">
          <div class="intro-icon">📋</div>
          <h2 class="intro-title">报告说明</h2>
        </div>
        <div class="intro-content">
          <div class="intro-text">
            <p class="intro-main">非常感谢您完成员工自我关怀问卷。</p>
            <div class="intro-points">
              <div class="point-item">
                <div class="point-number">1</div>
                <div class="point-text">
                  心理测评是了解心理状态的方法之一，其准确性受是否理解题意与认真作答、作答动机等多种因素的影响。在阅读本测评报告时，请结合作答时的状态，并参照日常生活中的实际情况来理解测试结果。
                </div>
              </div>
              <div class="point-item">
                <div class="point-number">2</div>
                <div class="point-text">
                  人的心理状态是动态变化的过程，不要给自己贴上负面标签，可以用理性、积极的眼光看待本次测评结果。
                </div>
              </div>
              <div class="point-item">
                <div class="point-number">3</div>
                <div class="point-text">
                  测评报告供您初步了解自己当前的心理状态，不能作为临床诊断的依据，如果您对测评结果有疑问或正在受心理问题困扰，请向专业人员寻求建议和帮助。
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 报告结果 -->
      <div class="report-results-section">
        <div class="results-header">
          <div class="results-icon">📊</div>
          <h2 class="results-title">测评结果详情</h2>
          <div class="results-subtitle">历史记录报告</div>
        </div>

        <!-- Part1: 情绪困扰评估 -->
        <div
          v-if="report.part1"
          class="report-section part1"
          :style="getSectionStyle(0)"
        >
          <div class="section-header">
            <div class="section-icon">😊</div>
            <div class="section-title-content">
              <h3 class="section-title">情绪困扰评估</h3>
              <div class="section-subtitle">Emotional Distress Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part1.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
            </div>
            <div class="info-box">
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">{{ report.part1.info }}</p>
            </div>
            <div class="advice-box">
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div class="advice-content" v-html="report.part1.advice"></div>
            </div>
          </div>
        </div>

        <!-- Part2: 焦虑评估 -->
        <div
          v-if="report.part2"
          class="report-section part2"
          :style="getSectionStyle(1)"
        >
          <div class="section-header">
            <div class="section-icon">😰</div>
            <div class="section-title-content">
              <h3 class="section-title">{{ report.part2.entityName }}</h3>
              <div class="section-subtitle">Anxiety Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part2.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
            </div>
            <div class="info-box">
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">{{ report.part2.entityExplain }}</p>
            </div>
            <div class="advice-box">
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div
                class="advice-content"
                v-html="formatAdvice(report.part2.entityAd)"
              ></div>
            </div>
          </div>
        </div>

        <!-- Part3: 抑郁评估 -->
        <div
          v-if="report.part3"
          class="report-section part3"
          :style="getSectionStyle(2)"
        >
          <div class="section-header">
            <div class="section-icon">😔</div>
            <div class="section-title-content">
              <h3 class="section-title">{{ report.part3.entityName }}</h3>
              <div class="section-subtitle">Depression Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part3.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
            </div>
            <div class="info-box">
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">{{ report.part3.entityExplain }}</p>
            </div>
            <div class="advice-box">
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div
                class="advice-content"
                v-html="formatAdvice(report.part3.entityAd)"
              ></div>
            </div>
          </div>
        </div>

        <!-- Part4: 压力评估 -->
        <div
          v-if="report.part4"
          class="report-section part4"
          :style="getSectionStyle(3)"
        >
          <div class="section-header">
            <div class="section-icon">😫</div>
            <div class="section-title-content">
              <h3 class="section-title">{{ report.part4.entityName }}</h3>
              <div class="section-subtitle">Stress Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part4.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
              <div class="score-details">
                <div class="detail-item">
                  <span class="detail-label">评估维度</span>
                  <span class="detail-value">压力水平</span>
                </div>
                <div class="detail-item">
                  <span class="detail-label">报告类型</span>
                  <span class="detail-value">历史记录</span>
                </div>
              </div>
            </div>
            <div class="info-box">
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">{{ report.part4.entityExplain }}</p>
            </div>
            <div class="advice-box">
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div
                class="advice-content"
                v-html="formatAdvice(report.part4.entityAd)"
              ></div>
            </div>
          </div>
        </div>

        <!-- Part5: 预留模板 -->
        <div
          v-if="report.part5"
          class="report-section part5"
          :style="getSectionStyle(4)"
        >
          <div class="section-header">
            <div class="section-icon">📝</div>
            <div class="section-title-content">
              <h3 class="section-title">
                {{ report.part5.entityName || "第五部分" }}
              </h3>
              <div class="section-subtitle">Additional Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div v-if="report.part5.score" class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part5.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
              <div class="score-details">
                <div class="detail-item">
                  <span class="detail-label">评估维度</span>
                  <span class="detail-value">补充评估</span>
                </div>
                <div class="detail-item">
                  <span class="detail-label">报告类型</span>
                  <span class="detail-value">历史记录</span>
                </div>
              </div>
            </div>
            <div
              v-if="report.part5.info || report.part5.entityExplain"
              class="info-box"
            >
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">
                {{ report.part5.info || report.part5.entityExplain }}
              </p>
            </div>
            <div
              v-if="report.part5.advice || report.part5.entityAd"
              class="advice-box"
            >
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div
                class="advice-content"
                v-html="
                  formatAdvice(report.part5.advice || report.part5.entityAd)
                "
              ></div>
            </div>
          </div>
        </div>

        <!-- Part6: 睡眠质量评估 -->
        <div
          v-if="report.part6"
          class="report-section part6"
          :style="getSectionStyle(5)"
        >
          <div class="section-header">
            <div class="section-icon">😴</div>
            <div class="section-title-content">
              <h3 class="section-title">睡眠质量评估</h3>
              <div class="section-subtitle">Sleep Quality Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div class="info-box">
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">{{ report.part6.info }}</p>
            </div>
            <div class="advice-box">
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div class="advice-content" v-html="report.part6.advice"></div>
            </div>
          </div>
        </div>

        <!-- Part7: 幸福感评估 -->
        <div
          v-if="report.part7"
          class="report-section part7"
          :style="getSectionStyle(6)"
        >
          <div class="section-header">
            <div class="section-icon">😄</div>
            <div class="section-title-content">
              <h3 class="section-title">{{ report.part7.entityName }}</h3>
              <div class="section-subtitle">Well-being Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part7.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
              <div class="score-details">
                <div class="detail-item">
                  <span class="detail-label">评估维度</span>
                  <span class="detail-value">幸福感</span>
                </div>
                <div class="detail-item">
                  <span class="detail-label">报告类型</span>
                  <span class="detail-value">历史记录</span>
                </div>
              </div>
            </div>
            <div class="info-box">
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">{{ report.part7.entityExplain }}</p>
            </div>
            <div class="advice-box">
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <p class="advice-text">{{ report.part7.entityAd }}</p>
            </div>
          </div>
        </div>

        <!-- Part8: 预留模板 -->
        <div
          v-if="report.part8"
          class="report-section part8"
          :style="getSectionStyle(7)"
        >
          <div class="section-header">
            <div class="section-icon">🔍</div>
            <div class="section-title-content">
              <h3 class="section-title">
                {{ report.part8.entityName || "第八部分" }}
              </h3>
              <div class="section-subtitle">Extended Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div v-if="report.part8.score" class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part8.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
              <div class="score-details">
                <div class="detail-item">
                  <span class="detail-label">评估维度</span>
                  <span class="detail-value">扩展评估</span>
                </div>
                <div class="detail-item">
                  <span class="detail-label">报告类型</span>
                  <span class="detail-value">历史记录</span>
                </div>
              </div>
            </div>
            <div
              v-if="report.part8.info || report.part8.entityExplain"
              class="info-box"
            >
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">
                {{ report.part8.info || report.part8.entityExplain }}
              </p>
            </div>
            <div
              v-if="report.part8.advice || report.part8.entityAd"
              class="advice-box"
            >
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div
                class="advice-content"
                v-html="
                  formatAdvice(report.part8.advice || report.part8.entityAd)
                "
              ></div>
            </div>
          </div>
        </div>

        <!-- Part9: 预留模板 -->
        <div
          v-if="report.part9"
          class="report-section part9"
          :style="getSectionStyle(8)"
        >
          <div class="section-header">
            <div class="section-icon">📈</div>
            <div class="section-title-content">
              <h3 class="section-title">
                {{ report.part9.entityName || "第九部分" }}
              </h3>
              <div class="section-subtitle">Comprehensive Assessment</div>
            </div>
          </div>
          <div class="section-content">
            <div v-if="report.part9.score" class="score-display">
              <div class="score-circle">
                <span class="score-value">{{
                  parseFloat(report.part9.score).toFixed(1)
                }}</span>
                <span class="score-label">得分</span>
              </div>
              <div class="score-details">
                <div class="detail-item">
                  <span class="detail-label">评估维度</span>
                  <span class="detail-value">综合评估</span>
                </div>
                <div class="detail-item">
                  <span class="detail-label">报告类型</span>
                  <span class="detail-value">历史记录</span>
                </div>
              </div>
            </div>
            <div
              v-if="report.part9.info || report.part9.entityExplain"
              class="info-box"
            >
              <div class="info-header">
                <div class="info-icon">💡</div>
                <h4 class="info-title">评估说明</h4>
              </div>
              <p class="info-text">
                {{ report.part9.info || report.part9.entityExplain }}
              </p>
            </div>
            <div
              v-if="report.part9.advice || report.part9.entityAd"
              class="advice-box"
            >
              <div class="advice-header">
                <div class="advice-icon">💭</div>
                <h4 class="advice-title">专业建议</h4>
              </div>
              <div
                class="advice-content"
                v-html="
                  formatAdvice(report.part9.advice || report.part9.entityAd)
                "
              ></div>
            </div>
          </div>
        </div>

        <!-- 报告总结 -->
        <div class="report-summary">
          <div class="summary-header">
            <div class="summary-icon">⭐</div>
            <h3 class="summary-title">报告总结</h3>
          </div>
          <div class="summary-content">
            <p class="summary-text">
              本报告为历史测评记录，反映了您在特定时间段内的心理状态。请理性看待测评结果，将其作为自我了解的参考。
              如需进一步的专业咨询，建议联系心理健康专业人士。
            </p>
            <div class="summary-meta">
              <div class="meta-item">
                <span class="meta-label">报告生成时间：</span>
                <span class="meta-value">{{ getCurrentTime() }}</span>
              </div>
              <div class="meta-item">
                <span class="meta-label">报告类型：</span>
                <span class="meta-value">历史记录报告</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 没有数据时的提示 -->
    <div v-else class="no-data">
      <div class="no-data-icon">📄</div>
      <p class="no-data-text">暂无报告数据</p>
      <button class="retry-btn" @click="getRecordReport">重新加载</button>
    </div>
  </div>
</template>

<script>
import { getRecordReport } from "@/api/CP";

export default {
  data() {
    return {
      report: {},
      votelogId: null,
      loading: true,
    };
  },
  computed: {
    hasReportData() {
      return Object.keys(this.report).length > 0;
    },
  },
  methods: {
    // 获取个人报告
    getRecordReport() {
      this.loading = true;
      getRecordReport({
        votelogId: this.votelogId,
        partOneScore: localStorage.getItem("partOneScore"),
      })
        .then((res) => {
          if (res.code === 200) {
            this.report = res.data;
            // 成功后移除partOneScore
            // localStorage.removeItem("partOneScore");
          } else {
            this.$toast?.("获取报告失败");
          }
        })
        .catch((error) => {
          console.error("获取报告失败:", error);
          this.$toast?.("获取报告失败");
        })
        .finally(() => {
          this.loading = false;
        });
    },
    // 格式化建议内容（将换行符转换为HTML）
    formatAdvice(text) {
      if (!text) return "";
      // 如果是HTML内容，直接返回
      if (text.includes("<p>") || text.includes("<div>")) {
        return text;
      }
      // 否则处理普通文本的换行和空格
      return text.replace(/\n/g, "<br>").replace(/   /g, "&nbsp;&nbsp;&nbsp;");
    },
    // 返回上一页
    goBack() {
      this.$router.go(-1);
    },
    // 获取部分样式（用于动画延迟）
    getSectionStyle(index) {
      return {
        "--section-index": index + 1,
        "animation-delay": `${index * 0.1}s`,
      };
    },
    // 获取当前时间
    getCurrentTime() {
      return new Date().toLocaleString("zh-CN", {
        year: "numeric",
        month: "2-digit",
        day: "2-digit",
        hour: "2-digit",
        minute: "2-digit",
      });
    },
  },
  created() {
    this.votelogId = this.$route.query.votelogId;
    if (this.votelogId) {
      this.getRecordReport();
    } else {
      this.$toast?.("缺少必要参数");
      this.loading = false;
    }
  },
};
</script>

<style scoped>
.report-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 导航栏样式 */
.navbar {
  max-width: 500px;
  margin: 0 auto;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-back:hover {
  background: #e0e0e0;
}

.nav-title {
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.nav-placeholder {
  width: 40px;
}
/* 主内容区域 */
.page-content {
  margin: 0 auto;
  padding: 20px;
  margin-top: 50px;
}

/* 加载动画样式 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #6a11cb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  color: #666;
  font-size: 16px;
  margin: 0;
  font-weight: 500;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.report-content {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 报告说明部分 */
.report-intro-section {
  margin-top: 60px;
  background: white;
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-left: 6px solid #6a11cb;
  animation: slideInUp 0.6s ease-out;
}

.intro-header {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
}

.intro-icon {
  font-size: 32px;
  margin-right: 15px;
}

.intro-title {
  color: #333;
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-content {
  background: #f8f9ff;
  border-radius: 15px;
  padding: 25px;
}

.intro-main {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
  font-weight: 500;
}

.intro-points {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.point-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.point-number {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
  font-size: 14px;
  box-shadow: 0 4px 8px rgba(106, 17, 203, 0.3);
}

.point-text {
  color: #666;
  line-height: 1.7;
  font-size: 15px;
}

/* 报告结果部分 */
.report-results-section {
  animation: fadeIn 0.8s ease-out;
}

.results-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 10px;
}

.results-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.results-title {
  color: #333;
  font-size: 28px;
  font-weight: bold;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.results-subtitle {
  color: #666;
  font-size: 16px;
  font-weight: 500;
}

/* 报告部分样式 */
.report-section {
  background: white;
  border-radius: 20px;
  padding: 0;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.section-header {
  background: linear-gradient(
    135deg,
    var(--section-color, #6a11cb),
    color-mix(in srgb, var(--section-color, #6a11cb) 70%, black)
  );
  color: white;
  padding: 25px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.section-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  flex-shrink: 0;
}

.section-title-content {
  flex: 1;
}

.section-title {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 5px 0;
  color: white;
}

.section-subtitle {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
}

.section-content {
  padding: 30px;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9ff, #f0f2ff);
  border-radius: 15px;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--section-color, #6a11cb),
    color-mix(in srgb, var(--section-color, #6a11cb) 70%, white)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.score-circle::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.score-value {
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
}

.score-label {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 5px;
}

.score-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-label {
  color: #666;
  font-weight: 500;
  font-size: 14px;
}

.detail-value {
  color: #333;
  font-weight: 600;
  background: var(--section-color, #6a11cb);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.info-box,
.advice-box {
  background: #f8f9ff;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  border-left: 4px solid var(--section-color, #6a11cb);
}

.advice-box {
  background: #fff9e6;
  border-left-color: #ffc107;
}

.info-header,
.advice-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.info-icon,
.advice-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.info-title,
.advice-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.info-text,
.advice-content {
  color: #555;
  line-height: 1.7;
  margin: 0;
  font-size: 15px;
}

.advice-content {
  color: #666;
}

/* 报告总结 */
.report-summary {
  background: white;
  border-radius: 20px;
  padding: 30px;
  margin-top: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 2px solid #e3f2fd;
  animation: slideInUp 0.6s ease-out;
}

.summary-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.summary-icon {
  font-size: 28px;
  margin-right: 15px;
}

.summary-title {
  color: #333;
  font-size: 22px;
  font-weight: bold;
  margin: 0;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.summary-content {
  background: #f8f9ff;
  border-radius: 15px;
  padding: 25px;
}

.summary-text {
  color: #555;
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 20px;
}

.summary-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-label {
  color: #666;
  font-weight: 500;
  font-size: 14px;
}

.meta-value {
  color: #333;
  font-weight: 600;
  background: #6a11cb;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

/* 为不同部分定义颜色 */
.part1 {
  --section-color: #4facfe;
}
.part2 {
  --section-color: #ff6b6b;
}
.part3 {
  --section-color: #51cf66;
}
.part4 {
  --section-color: #ffd43b;
}
.part5 {
  --section-color: #cc5de8;
}
.part6 {
  --section-color: #f76707;
}
.part7 {
  --section-color: #20c997;
}
.part8 {
  --section-color: #e03131;
}
.part9 {
  --section-color: #6741d9;
}

/* 动画定义 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 没有数据时的提示 */
.no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.no-data-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.no-data-text {
  color: #666;
  font-size: 18px;
  margin-bottom: 30px;
  font-weight: 500;
}

.retry-btn {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(106, 17, 203, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header {
    padding: 12px 15px;
  }

  .report-content {
    padding: 15px;
  }

  .report-intro-section,
  .report-section,
  .report-summary {
    border-radius: 15px;
    padding: 20px;
  }

  .section-header {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .section-content {
    padding: 20px;
  }

  .score-display {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .score-circle {
    width: 100px;
    height: 100px;
  }

  .score-value {
    font-size: 28px;
  }

  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* 打印样式 */
@media print {
  .header,
  .back-btn {
    display: none;
  }

  .report-container {
    background: white;
  }

  .report-section {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  .score-circle::before {
    animation: none;
  }
}
</style>
